package edu.scau.divineplace.entity.query;

import edu.scau.divineplace.config.global.validate.annotation.NotContainBanWord;
import edu.scau.divineplace.entity.constant.ScoreConstants;
import edu.scau.divineplace.entity.validate.group.commentscore.ContentAndUser;
import edu.scau.divineplace.entity.validate.group.commentscore.Id;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author x1aolone
 * @since 2020-12-06
 */
@Data
public class CommentScoreQuery implements Serializable {

    @NotNull(groups = ContentAndUser.class)
    @ApiModelProperty(value = "内容id")
    private Long contentId;

    @NotNull(groups = ContentAndUser.class)
    @ApiModelProperty(value = "用户id")
    private Long userId;

    @Max(value = ScoreConstants.MAX, groups = {ContentAndUser.class, Id.class})
    @Min(value = ScoreConstants.MIN, groups = {ContentAndUser.class, Id.class})
    @ApiModelProperty(value = "用户打分")
    private Integer score;

    @NotContainBanWord(groups = {ContentAndUser.class, Id.class})
    @NotBlank(groups = {ContentAndUser.class, Id.class})
    @ApiModelProperty(value = "用户评论")
    private String comment;
}
